<?php
	include("TSPlanEstudio.php");

	$myusername=$_GET['user']; 
    
	session_start();
	if($_SESSION['myusername'] != null)
		header("location:main.php");
		
	$PE = new TSPlanEstudio();
	$RESULT = $PE->cargarPlanes();
	
	$COUNT =  mysql_num_rows($RESULT);
	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <link href="css/estilos.css" rel="stylesheet" type="text/css" />

		
        <!-- JQUERY para verificaciones -->
        <link href="css/jquery-ui-1.8.2.custom.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
        <script type="text/javascript" src="js/jquery.validate.min.js"></script>
        <script type="text/javascript" src="js/jquery-ui-1.8.2.custom.min.js"></script>	

        <script type="text/javascript">
            $(document).ready(function(){
                $("#form_login").validate({
                    rules: {
                        usuario: "required"
                    },
                    messages: {
                        usuario: " Por favor indique un usuario"	
                    }
                });
            });
        </script>
        <title>Bit&aacute;cora Electr&oacute;nica</title>
    </head>
    <body>
        <div id="pagina">
            <?php include ("header.php");?> 
        <!-- fin de header -->

            <div id="menucontainer">
                    <ul id="menu">
                            <li><a href="index.php">Home</a></li>
							<li><a href="index.php">Planes Estudio</a>
								<ul>
									<?php
									if($COUNT > 0){
										while($row = mysql_fetch_array($RESULT))
										{
									?>
										<li><a><?php echo $row['nombre']; ?></a></li>
									<?php 
										}}
									?>
								</ul>
							</li>
                    </ul>
            </div>
            <!-- fin menu -->

            <div id="contenido"> 
            <h1>Sitio Administrativo</h1>
            <form id="form_login" action="checklogin.php" method="POST">
                <table>
                    <tr>
                        <td>
                            <label>Usuario: </label>
                        </td>
                        <td>
                            <input type="usuario" id="usuario" name="usuario" value="<?php echo $myusername?>"; size="25" class="required"/>
                        </td>
                    </tr>
					<tr>
                        <td>
                            <label>Password: </label>
                        </td>
                        <td>
                            <input type="password" id="password" name="password" size="25"/><?php if($myusername!=null){?>										
																							<label id="error">Password incorrecto</label>
																							<?php		
																								   }
																							?>
                        </td>
                    </tr>
                     
                   <tr>
                        <td colspan="2">
                            <input class="submit" type="submit" value="Autenticar"/>
                        </td>
                   </tr>
                </table>
            </form>
			<!--<div id="bienvenida">
				Bit&aacute;cora estudiantil creada por: <br/> Jose Arias Quir&oacute;s <br/> David Mora Ballestero <br/> Mauricio Castillo Chavarr&iacute;a
			</div> -->
            </div>
            <!-- fin contenido -->

            <?php include ("footer.php");?> 
            <!-- fin footer -->

        </div>
	<!-- fin pagina -->
    </body>
</html>
